from ctypes import *

so_file = "./test.so"
my_functions = CDLL(so_file)

print(type(my_functions))
print(dir(my_functions))
f_stepper = my_functions.test
f_stepper()

f_get_red = my_functions.get_red
f_get_red.argtypes = [] 
f_get_red.restype = c_double

f_get_green = my_functions.get_green
f_get_green.argtypes = []
f_get_green.restype = c_double

f_get_blue = my_functions.get_blue
f_get_blue.argtypes = []
f_get_blue.restype = c_double

single_step = my_functions.ambientLightCtrl_step

print("#########")
print("LED RGB:", f_get_red(), f_get_green(), f_get_blue())
import time

while 1:
    single_step()
    print("LED RGB:", f_get_red(), f_get_green(), f_get_blue())
    time.sleep(0.1)
#ret = c_int.in_dll(my_functions, "a")
#print("RET:", ret.value)
